#if !defined(AFX_SHELLICONS_H__D01FAB3B_B7C7_46AE_B4AF_A1451B322A27__INCLUDED_)
#define AFX_SHELLICONS_H__D01FAB3B_B7C7_46AE_B4AF_A1451B322A27__INCLUDED_

#pragma once
#include <afxcmn.h>

class CShellIcons  
{
// Construction
public:
	CShellIcons();
	virtual ~CShellIcons();
	
// Operations
public:
	void	Clear();
	int		Get(LPCTSTR pszFile, int nSize);
	int		Add(HICON hIcon, int nSize);
	HICON	ExtractIcon(int nIndex, int nSize);
	int		GetFolderIcon(int nSize);
public:
	BOOL	Lookup(LPCTSTR pszType, HICON* phSmallIcon, HICON* phLargeIcon, CString* psName, CString* psMIME, HICON* phHugeIcon = NULL);
	CString	GetTypeString(LPCTSTR pszFile);

// Inlines
public:
	inline CImageList* GetObject(int nSize) const
	{
		switch ( nSize )
		{
		case 16:
			return (CImageList*)&m_i16;
		case 32:
			return (CImageList*)&m_i32;
		case 48:
			return (CImageList*)&m_i48;
		default:
			return NULL;
		}
	}

	HIMAGELIST GetHandle(int nSize) const
	{
		switch ( nSize )
		{
		case 16:
			return m_i16.m_hImageList;
		case 32:
			return m_i32.m_hImageList;
		case 48:
			return m_i48.m_hImageList;
		default:
			return NULL;
		}
	}
// Attributes
protected:
	CImageList		m_i16;
	CImageList		m_i32;
	CImageList		m_i48;
protected:
	CMapStringToPtr	m_m16;
	CMapStringToPtr	m_m32;
	CMapStringToPtr	m_m48;

	HINSTANCE m_hUser;
	UINT (WINAPI *m_pfnPrivate)(LPCTSTR, int, int, int, HICON*, UINT*, UINT, UINT);
};

enum
{
	SHI_FILE,
	SHI_PLUS,
	SHI_MINUS,
	SHI_TICK,
	SHI_BUSY,
	SHI_FIREWALL,
	SHI_UNSTABLE,
	SHI_COMPUTER,
	SHI_EXECUTABLE,
	SHI_CHAT,
	SHI_BROWSE,
	SHI_FOLDER_CLOSED,
	SHI_FOLDER_OPEN,
	SHI_LOCKED,
	SHI_SEARCH,
	SHI_PARTIAL,
	SHI_CHEVRON,
	SHI_STAR,
	SHI_PREVIEW,
	SHI_COLLECTION,
	SHI_FAKE,
	SHI_COMMERCIAL,
	SHI_MAX
};

enum
{
	SHI_O_NULL,
	SHI_O_LOCKED,
	SHI_O_PARTIAL,
	SHI_O_COLLECTION,
	SHI_O_COMMERCIAL,
	SHI_O_MAX
};

#endif // !defined(AFX_SHELLICONS_H__D01FAB3B_B7C7_46AE_B4AF_A1451B322A27__INCLUDED_)
